<!--
 * @Author: ljc
 * @Date: 2023-04-23 18:08:33
 * @LastEditors: g05047
 * @LastEditTime: 2023-05-05 11:14:56
 * @Description: 财评报告上传
-->
<template>
  <RkContainer :isFooter="false"
    :isAside="false">
    <template #header_left>
    </template>
    <template #header_right>
      <el-button @click="handleUpload">上传文件</el-button>
      <el-button type="primary"
        @click="handleSearch()">查询</el-button>
      <el-button>操作记录</el-button>
    </template>
    <template #main>
      <rk-condition>
        <template #condition>
        </template>
        <template #content>
          <rk-grid ref="finacialRef"
            title="财评报告上传"
            dataUrl="/proResApply/queryProjectList"
            boxConfig="radio"
            :params="queryParams"
            :columns="tableColumns"
            :footerConfig="{
              showFooter:true,
              footerParams:['applyAmt','proCapital','totalBudget']
            }">
            <template #toolbar_title_buttons>
              <el-select v-model="queryParams.dw"
                placeholder="请选择单位"
                class="mr-15px w-200px"
                clearable
                @change="handleSearch">
                <el-option v-for="item in COMMON_AMOUNT_UNIT.options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value" />
              </el-select>
              <el-input v-model="queryParams.mhcx"
                placeholder="请输入名称/编码"
                class="mr-15px w-200px"
                clearable
                @click="handleSearch">
              </el-input>
            </template>
          </rk-grid>
        </template>
      </rk-condition>
    </template>
  </RkContainer>
  <finacial-lawyer-drawer ref="finacialLawyerDrawerRef"></finacial-lawyer-drawer>
</template>
  <script setup>
import { ref } from 'vue'
import FinacialLawyerDrawer from '../drawer/FinacialLawyerDrawer.vue'
import { COMMON_AMOUNT_UNIT } from '@/enums/enums-common.js'

// 查询参数
const queryParams = reactive({
  adCode: '001',
  agencyType: 0,
  userCode: '',
  mhcx: undefined,
  dw: 2
})
const finacialLawyerDrawerRef = ref('')
const finacialRef = ref('')
const tableColumns = ref([
  { field: 'agName', title: '申报单位', width: 300, align: 'left', headerAlign: 'center' },
  { field: 'proName', title: '项目名称', align: 'left', width: 300, headerAlign: 'center' },
  { field: 'proCode', title: '项目编码', align: 'left', width: 300, headerAlign: 'center' },
  {
    field: 'isDebtApprove', title: '主管部门是否审批', width: 200, align: 'center', slots: {
      default: ({ row, }) => {
        const isDebtApprove = (row.isDebtApprove === '1' ? '是' : '否')
        return isDebtApprove
      }
    }
  },
  {
    field: 'isEia', title: '是否完成环评工作', width: 200, align: 'center', slots: {
      default: ({ row, }) => {
        const isEia = (row.isEia === '1' ? '是' : '否')
        return isEia
      }
    }
  },
  {
    field: 'isSecurityAsmt', title: '是否完成安评工作', width: 200, align: 'center', slots: {
      default: ({ row, }) => {
        const isSecurityAsmt = (row.isSecurityAsmt === '1' ? '是' : '否')
        return isSecurityAsmt
      }
    }
  },
  {
    field: 'isBId', title: '是否完成招投标工作', width: 200, align: 'center', slots: {
      default: ({ row, }) => {
        const isBId = (row.isBId === '1' ? '是' : '否')
        return isBId
      }
    }
  },
  {
    field: 'isLehr', title: '是否完成征地拆迁等相关工作', width: 250, align: 'center', slots: {
      default: ({ row, }) => {
        const isLehr = (row.isLehr === '1' ? '是' : '否')
        return isLehr
      }
    }
  },
  {
    field: 'isHaveLuc', title: '是否取得《国有土地使用证》', width: 250, align: 'center', slots: {
      default: ({ row, }) => {
        const isHaveLuc = (row.isHaveLuc === '1' ? '是' : '否')
        return isHaveLuc
      }
    }
  },
  {
    field: 'isHavePp', title: '是否取得《建设用地规划使用证》', width: 250, align: 'center', slots: {
      default: ({ row, }) => {
        const isHavePp = (row.isHavePp === '1' ? '是' : '否')
        return isHavePp
      }
    }
  },
  {
    field: 'isHavelup', title: '是否取得《建设工程规划使用证》', width: 250, align: 'center', slots: {
      default: ({ row, }) => {
        const isHavelup = (row.isHavePp === '1' ? '是' : '否')
        return isHavelup
      }
    }
  },
  {
    field: 'createTime', title: '是否取得《建设工程施工使用证》', width: 250, align: 'center', slots: {
      default: ({ row, }) => {
        const isHaveCp = (row.isHavePp === '1' ? '是' : '否')
        return isHaveCp
      }
    }
  },
  {
    field: 'isHaveExEval', title: '实施方案中是否事前绩效评估内容', width: 250, align: 'center', slots: {
      default: ({ row, }) => {
        const isHaveExEval = (row.isHaveExEval === '1' ? '是' : '否')
        return isHaveExEval
      }
    }
  },
  { field: 'applyDate', title: '年度', width: 100, align: 'center' },
  { field: 'zqqxName', title: '债券期限', width: 100, align: 'center' },
  { field: 'applyAmt', title: '申请金额', width: 200, align: 'right', formatter: 'formatThousand' },
  { field: 'proCapital', title: '项目资本金', width: 200, align: 'right', formatter: 'formatThousand' },
  { field: 'zqlbName', title: '申请类型', width: 100, align: 'center' },
  { field: 'setupYear', title: '立项年度', width: 100, align: 'center' },
  { field: 'xmlxName', title: '项目类型', width: 150, align: 'center' },
  { field: 'zjtxlyName', title: '资金投向领域', width: 200, align: 'left' },
  { field: 'totalBudget', title: '项目总概算', width: 200, align: 'right', formatter: 'formatThousand' },
  { field: 'startDate', title: '开工日期', width: 100, align: 'center' },
  { field: 'endDate', title: '竣工日期', width: 100, align: 'center' },
  { field: 'jsztName', title: '建设状态', width: 100, align: 'left' },
  { field: 'ndrcProCode', title: '发改委审批监管代码', width: 250, align: 'left' },
])
/**查询 */
const handleSearch = () => {
  finacialRef.value.searchEvent()
}
/**上传 */
const handleUpload = () => {
  finacialLawyerDrawerRef.value.handleOpen()
}
  </script>
  
  <style lang="scss" scoped>
.mr-15px {
  margin-right: 15px;
  &:last-child {
    margin-right: 0;
  }
}
.w-200px {
  width: 200px;
}
</style>
  